package com.xmtlxx.wms.mapper;

import com.xmtlxx.common.annotation.DataColumn;
import com.xmtlxx.common.annotation.DataPermission;
import com.xmtlxx.common.core.mapper.BaseMapperPlus;
import com.xmtlxx.wms.domain.Deal;
import com.xmtlxx.wms.domain.bo.DealBo;
import com.xmtlxx.wms.domain.vo.DealVo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 处置Mapper接口
 *
 * @author xmtlxx
 * @date 2022-08-15
 */
public interface DealMapper extends BaseMapperPlus<DealMapper, Deal, DealVo> {
    /**
     * 根据条件分页查询处置
     *
     * @param deal 处置
     * @return Page Deal
     */
    @DataPermission({
        @DataColumn(key = "tenantName", value = "d.create_by"),
        @DataColumn(key = "deptName", value = "d.dept_id"),
        @DataColumn(key = "userName", value = "d.create_by")
    })
    Page<DealVo> selectPageDealList(@Param("page") Page<Deal> page,@Param("deal") DealBo deal);

    /**
     * 查询处置列表
     *
     * @param deal 处置
     * @return 处置集合
     */
    @DataPermission({
        @DataColumn(key = "tenantName", value = "d.create_by"),
        @DataColumn(key = "deptName", value = "d.dept_id"),
        @DataColumn(key = "userName", value = "d.create_by")
    })
    List<DealVo> selectDealList(@Param("deal") DealBo deal);

    DealVo selectDealVoByID(String id);

    Deal selectDealVoByNo(@Param("dealNo") String dealNo,@Param("taskId") String taskId);

    DealVo selectDealVoByTaskId(String taskId);

    void deleteWithDealDtlById(String id);

    void deleteByTaskId(String id);

    List<Deal> selectDealListByTaskId(String taskId);

    int updateDeal(@Param("deal") Deal deal);

    List<DealVo> selectDealByList(@Param("deal") DealBo deal);

    Deal selectDealByTaskId(String taskId);
}
